package com.shensi.api.admin.client.fleet;

import com.shensi.api.admin.client.fallback.fleet.FleetSubcardClientFallBack;
import com.shensi.api.admin.client.fallback.monitor.SysLogininforClientFallBack;
import com.shensi.api.admin.domian.device.dto.FleetSubcardDto;
import com.shensi.api.admin.domian.device.vo.FleetSubcardVo;
import com.shensi.common.core.constant.CloudConstant;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = FleetSubcardClientFallBack.class)
@Component
public interface FleetSubcardClient {

    /**
     * 根据ID获取车队子卡信息
     */
    @GetMapping("/fleetSubcards/{id}")
    public FleetSubcardVo getFleetSubcardById(@PathVariable("id") Integer id);

    /**
     * 获取所有车队子卡信息
     */
    @GetMapping("/fleetSubcards/all")
    public List<FleetSubcardVo> getAllFleetSubcards();

    /**
     * 创建车队子卡
     */
    @PostMapping("/fleetSubcards/create")
    public void createFleetSubcard(@RequestBody FleetSubcardDto fleetSubcard);

    /**
     * 更新车队子卡信息
     */
    @PutMapping("/fleetSubcards/update")
    public void updateFleetSubcard(@RequestBody FleetSubcardDto fleetSubcard);

    /**
     * 根据ID删除车队子卡
     */
    @DeleteMapping("/fleetSubcards/{id}")
    public void deleteFleetSubcardById(@PathVariable("id") Integer id);

    /**
     * 批量删除车队子卡
     */
    @DeleteMapping("/fleetSubcards/batchDelete")
    public void deleteFleetSubcardsByIds(@RequestBody List<Integer> ids);
}
